package com.example.demo.controller;

import com.example.demo.feign.DemoFeignApi;
import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;


/**
 * Created by Administrator on 2018/4/1.
 */
@RestController
public class TestController {

    @Autowired
    DemoFeignApi feignApi;

    @RequestMapping(value = "/feign/consumer/userSave",method = RequestMethod.POST,produces = "application/json")
    @ResponseBody
    public String userSave() {
        System.out.println(">>>>>>>>>>consumer.userSave");
        String resp = feignApi.userSave(new User(1, "qwer", "12456", new Date()));
        System.out.println(">>>>>>>>>> resp: {}" + resp);
        return resp;
    }



}
